<template>
  <div>
    <p>父组件：state > {{ state }}</p>
    <p> 子组件： <Child1 /></p>
    <button @click="changeState">修改父组件中的state</button>
  </div>
</template>

<script setup lang="ts">
import Child1 from './children1.vue';
import { useGlobalState } from './store';

const state = useGlobalState();

function changeState() {
  state.value! += 1;
}
</script>
